package com.ctgu.springshiro.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.util.Set;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class User {

    @NotNull
    private Integer id;

    private String username;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Integer age;

    @JsonProperty("account")
    private String phone;

    @JsonIgnore
    private String email;

    private String password;

    private Set<Role> roles;

}
